/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.examination.vip.entity;

import com.jeesite.common.entity.BaseEntity;
import com.jeesite.modules.zx.examination.entity.Texamination;
import com.jeesite.modules.zx.examination.room.entity.TexaminationRoom;
import com.jeesite.modules.zx.user.entity.ZxUser;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 考试会员管理Entity
 *
 * @author zpp
 * @version 2020-03-22
 */
@Table(name = "t_examination_vip", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "exam_id", attrName = "examId", label = "考试主键"),
        @Column(name = "vip_user", attrName = "vipUser", label = "会员标识"),
        @Column(name = "room", attrName = "room", label = "考场"),
        @Column(name = "scene", attrName = "scene", label = "场次"),
        @Column(name = "start_date", attrName = "startDate", label = "考试开始时间",queryType = QueryType.GTE),
        @Column(name = "end_date", attrName = "endDate", label = "考试结束时间",queryType = QueryType.LTE),
        @Column(name = "ticket_id", attrName = "ticketId", label = "准考证标识"),
}, joinTable = {
        @JoinTable(type = Type.LEFT_JOIN, entity = Texamination.class, alias = "e",
            on = "e.id = a.exam_id", attrName = "texamination",
            columns = {
                    @Column(name = "obj_name", attrName = "objName", label = "数据名称", queryType = QueryType.LIKE),
            }),
        @JoinTable(type = Type.LEFT_JOIN, entity = TexaminationRoom.class, alias = "r",
            on = "r.id = a.room", attrName = "texaminationRoom",
            columns = {
                @Column(name = "room_name", attrName = "roomName", label = "考场名称", queryType = QueryType.LIKE),
            }),
        @JoinTable(type = Type.LEFT_JOIN, entity = ZxUser.class, alias = "u",
            on = "u.user_code = a.vip_user", attrName = "zxUser",
            columns = {
                    @Column(name = "user_name", attrName = "userName", label = "用户昵称", queryType = QueryType.LIKE),
            }),
}, orderBy = "a.id DESC"
)
public class TexaminationVip extends DataEntity<TexaminationVip> {

    private static final long serialVersionUID = 1L;
    private String examId, examName;        // 考试主键
    private String vipUser, userName;        // 会员标识
    private String room, roomName, scene;        // 考场
    private Date startDate;        // 考试开始时间
    private Date endDate;        // 考试结束时间
    private String ticketId;        // 准考证标识

    private Texamination texamination;
    private TexaminationRoom texaminationRoom;
    private ZxUser zxUser;

    public Texamination getTexamination() {
        return texamination;
    }

    public void setTexamination(Texamination texamination) {
        this.texamination = texamination;
    }

    public TexaminationRoom getTexaminationRoom() {
        return texaminationRoom;
    }

    public void setTexaminationRoom(TexaminationRoom texaminationRoom) {
        this.texaminationRoom = texaminationRoom;
    }

    public ZxUser getZxUser() {
        return zxUser;
    }

    public void setZxUser(ZxUser zxUser) {
        this.zxUser = zxUser;
    }

    public String getScene() {
        return scene;
    }

    public void setScene(String scene) {
        this.scene = scene;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public TexaminationVip() {
        this(null);
    }

    public TexaminationVip(String id) {
        super(id);
    }

    @Length(min = 0, max = 50, message = "考试主键长度不能超过 50 个字符")
    public String getExamId() {
        return examId;
    }

    public void setExamId(String examId) {
        this.examId = examId;
    }

    @Length(min = 0, max = 50, message = "会员标识长度不能超过 50 个字符")
    public String getVipUser() {
        return vipUser;
    }

    public void setVipUser(String vipUser) {
        this.vipUser = vipUser;
    }

    @Length(min = 0, max = 50, message = "考场长度不能超过 50 个字符")
    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Length(min = 0, max = 50, message = "准考证标识长度不能超过 50 个字符")
    public String getTicketId() {
        return ticketId;
    }

    public void setTicketId(String ticketId) {
        this.ticketId = ticketId;
    }

}